import { Form, Input, Button, Select } from 'antd';
const { Option } = Select;
const layout = {
    labelCol: {
        span: 8,
    },
    wrapperCol: {
        span: 16,
    },
};
const tailLayout = {
    wrapperCol: {
        offset: 8,
        span: 16,
    },
};

export const Demo = () => {
    const [form] = Form.useForm();

    // const onGenderChange = (value) => {
    //     switch (value) {
    //         case 'male':
    //             form.setFieldsValue({
    //                 note: 'Hi, man!',
    //             });
    //             return;
    //
    //         case 'female':
    //             form.setFieldsValue({
    //                 note: 'Hi, lady!',
    //             });
    //             return;
    //
    //         case 'other':
    //             form.setFieldsValue({
    //                 note: 'Hi there!',
    //             });
    //     }
    // };

    // const onFinish2 = (values) => {
    //     console.log(values);
    // };

    // const onReset2 = () => {
    //     form.resetFields();
    // };

    // const onFill2 = () => {
    //     form.setFieldsValue({
    //         note: 'Hello world!',
    //         gender: 'male',
    //     });
    // };

    return(

        <Form {...layout} form={form} name="control-hooks" onFinish={onFinish}>
            <Form.Item
                name="memberName"
                label="名称"
                rules={[
                    {
                        required: true,
                    },
                ]}
            >
                <Input />
            </Form.Item>
            <Form.Item
                name="aliasTable"
                label="别名表"
                rules={[
                    {
                        required: false,
                    },
                ]}
            >
                <Select
                    placeholder="Select a option and change input text above"
                    // onChange={onGenderChange}
                    allowClear
                >
                    {/*<Option value="male">male</Option>*/}
                    {/*<Option value="female">female</Option>*/}
                    {/*<Option value="other">other</Option>*/}
                </Select>
            </Form.Item>
            <Form.Item
                name="description"
                label="说明"
                rules={[
                    {
                        required: false,
                    },
                ]}
            >
                <Input />
            </Form.Item>

            {/*//模型*/}



            <Form.Item
                name="dataStore"
                label="数据存储："
                rules={[
                    {
                        required: false,
                    },
                ]}
            >
                <Select
                    placeholder="Select a option and change input text above"
                    // onChange={onGenderChange}
                    allowClear
                >
                    {/*<Option value="male">male</Option>*/}
                    {/*<Option value="female">female</Option>*/}
                    {/*<Option value="other">other</Option>*/}
                </Select>
            </Form.Item>


            <Form.Item
                name="accountType"
                label="科目类型："
                rules={[
                    {
                        required: false,
                    },
                ]}
            >
                <Select
                    placeholder="Select a option and change input text above"
                    // onChange={onGenderChange}
                    allowClear
                >
                    {/*<Option value="male">male</Option>*/}
                    {/*<Option value="female">female</Option>*/}
                    {/*<Option value="other">other</Option>*/}
                </Select>
            </Form.Item>

            <Form.Item
                name="blanceType"
                label="余额类型："
                rules={[
                    {
                        required: false,
                    },
                ]}
            >
                <Select
                    placeholder="Select a option and change input text above"
                    // onChange={onGenderChange}
                    allowClear
                >
                    {/*<Option value="male">male</Option>*/}
                    {/*<Option value="female">female</Option>*/}
                    {/*<Option value="other">other</Option>*/}
                </Select>
            </Form.Item>



            <Form.Item
                name="dataType"
                label="数据类型："
                rules={[
                    {
                        required: false,
                    },
                ]}
            >
                <Select
                    placeholder="Select a option and change input text above"
                    // onChange={onGenderChange}
                    allowClear
                >
                    {/*<Option value="male">male</Option>*/}
                    {/*<Option value="female">female</Option>*/}
                    {/*<Option value="other">other</Option>*/}
                </Select>
            </Form.Item>



            <Form.Item {...tailLayout}>
                <Button type="primary" htmlType="submit">
                    Submit
                </Button>
                <Button htmlType="button" onClick={onReset}>
                    Reset
                </Button>

            </Form.Item>
        </Form>

    )
};
